home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume13 / xboard / patch1 < prev    next >
Encoding:
Internet Message Format  |  1991-07-05  |  9.5 KB

  1. Path: uunet!cs.utexas.edu!convex!texsun!cronkite!exodus!Pa.dec.com!dbs
  2. From: dbs@Pa.dec.com
  3. Newsgroups: comp.sources.x
  4. Subject: v13i073: xboard, Patch1, Part01/01
  5. Message-ID: <16336@exodus.Eng.Sun.COM>
  6. Date: 6 Jul 91 07:06:56 GMT
  7. References: <csx-13i073-xboard@uunet.UU.NET>
  8. Sender: news@exodus.Eng.Sun.COM
  9. Lines: 308
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: dbs@Pa.dec.com
  13. Posting-number: Volume 13, Issue 73
  14. Archive-name: xboard/patch1
  15. Patch-To: xboard: Volume 13, Issue 57-62
  16.  
  17. Here is a minor patch to xboard 1.2.  Here is a list of the fixes:
  18.  
  19.   Minor fixes to the 1.2 release
  20.  
  21.   - Multiple uses of the get positition file button got confused
  22.     on the second click.
  23.  
  24.   - Long game file comments cause core dumps on HP systems.
  25.  
  26.   - Parsed comments as [ ..............text follows ] into d7d5
  27.  
  28.   - New-line wasn't always being added to forward move strings sent to gnuchess.
  29.  
  30.   - Put easy back into the initString.  This DISABLES easy mode which by
  31.     default is ON.
  32.  
  33.   - Can't do a backward move when it isn't your turn because gnuchess
  34.     gets confused.  Similar bug for forward move.  Do a bunch of moves,
  35.     back up move and go forward.  These get filtered out now.
  36.  
  37. The version of xboard on export.lcs.mit.edu (18.30.0.238) has been updated
  38. to include this patch.
  39.  
  40. --Chris
  41.  
  42. diff -c rev5/Imakefile rev6/Imakefile
  43. *** rev5/Imakefile    Fri Jun  7 10:53:04 1991
  44. --- rev6/Imakefile    Mon Jun 24 16:47:41 1991
  45. ***************
  46. *** 17,22 ****
  47.   depend:: parser.c
  48.   
  49.   clean::
  50. !     $(RM) parser.c
  51.   
  52.   ComplexProgramTarget(xboard)
  53. --- 17,22 ----
  54.   depend:: parser.c
  55.   
  56.   clean::
  57. !     $(RM) parser.c chess.lst
  58.   
  59.   ComplexProgramTarget(xboard)
  60. diff -c rev5/README rev6/README
  61. *** rev5/README    Wed Jun 12 14:07:33 1991
  62. --- rev6/README    Wed Jun 26 14:30:42 1991
  63. ***************
  64. *** 39,45 ****
  65.   
  66.   CAVEATS
  67.   
  68. ! XBoard depends on the R4 Xt Intrinsics and R4 Athena Widget Set.  R3 won't do.
  69.   XBoard works best with the version 3.1+ of gnuchess.  There has been one patch
  70.   and it is necessary.  This release of gnuchess was dated: Mon Apr 15 10:20 1991
  71.   by Mike McGann and should be available from comp.sources.misc archives.
  72. --- 39,49 ----
  73.   
  74.   CAVEATS
  75.   
  76. ! XBoard depends on the R4 Xt Intrinsics and R4 Athena Widget Set.  In particular,
  77. ! R3 just won't do.  XBoard uses R4 features.  The standard DEC and SUN releases
  78. ! won't do either.  The Athena widgets are either missing in the DEC standard
  79. ! distribution or in the wrong (R3) place in SUN OpenWindows.
  80.   XBoard works best with the version 3.1+ of gnuchess.  There has been one patch
  81.   and it is necessary.  This release of gnuchess was dated: Mon Apr 15 10:20 1991
  82.   by Mike McGann and should be available from comp.sources.misc archives.
  83. ***************
  84. *** 227,235 ****
  85.     - Changed the protocol that xboard uses to work with the new version of
  86.       gnuchessr.
  87.   
  88. -   - Turned off the easy mode.
  89.     - For version 1.2, Jeff Kenton, Richard LLoyd, David Jensen, Martin D.,
  90.       Bill Schmidt, Scott Hemphill, Paul Vaughan and Bill Shauck all found
  91.       a lot of bugs that we put into xboard just to see if they were paying
  92.       attention.  They were.
  93. --- 231,257 ----
  94.     - Changed the protocol that xboard uses to work with the new version of
  95.       gnuchessr.
  96.   
  97.     - For version 1.2, Jeff Kenton, Richard LLoyd, David Jensen, Martin D.,
  98.       Bill Schmidt, Scott Hemphill, Paul Vaughan and Bill Shauck all found
  99.       a lot of bugs that we put into xboard just to see if they were paying
  100.       attention.  They were.
  101. + Thu Jun 20 15:04:06 PDT 1991
  102. +   Minor fixes to the 1.2 release
  103. +   - Multiple uses of the get positition file button got confused
  104. +     on the second click.
  105. +   - Long game file comments cause core dumps on HP systems.
  106. +   - Parsed comments as [ ..............text follows ] into d7d5
  107. +   - New-line wasn't always being added to forward move strings sent to gnuchess.
  108. +   - Put easy back into the initString.  This DISABLES easy mode which by
  109. +     default is ON.
  110. +   - Can't do a backward move when it isn't your turn because gnuchess
  111. +     gets confused.  Similar bug for forward move.  Do a bunch of moves,
  112. +     back up move and go forward.  These get filtered out now.
  113. Common subdirectories: rev5/bitmaps and rev6/bitmaps
  114. diff -c rev5/parser.l rev6/parser.l
  115. *** rev5/parser.l    Tue Jun 11 16:59:17 1991
  116. --- rev6/parser.l    Fri Jun 14 14:03:35 1991
  117. ***************
  118. *** 37,42 ****
  119. --- 37,44 ----
  120.   
  121.   #define A_I(ch)            (tolower(ch) - 'a')
  122.   #define NO_CONSTRAINT    -1
  123. + #undef YYLMAX
  124. + #define YYLMAX            2048
  125.   #undef input
  126.   
  127.   #define KING_TEST(r, f, piece) { \
  128. diff -c rev5/patchlevel.h rev6/patchlevel.h
  129. *** rev5/patchlevel.h    Fri May 17 15:37:36 1991
  130. --- rev6/patchlevel.h    Thu Jun 20 15:02:30 1991
  131. ***************
  132. *** 1 ****
  133. ! #define PATCHLEVEL 4
  134. --- 1 ----
  135. ! #define PATCHLEVEL 5
  136. diff -c rev5/xboard.c rev6/xboard.c
  137. *** rev5/xboard.c    Wed Jun 12 11:02:16 1991
  138. --- rev6/xboard.c    Wed Jun 26 11:09:54 1991
  139. ***************
  140. *** 1361,1371 ****
  141.   
  142.       move_type = (ChessMove) yylex();
  143.   
  144. !     if (xboardDebug)
  145.           if (move_type == BadMove)
  146. !             fprintf(stderr, "BadMove parsing %s\n", yytext);
  147.           else
  148.               fprintf(stderr, "Parsed %s into %s", yytext, currentMoveString);
  149.   
  150.       switch (move_type) {
  151.       case Comment:
  152. --- 1361,1377 ----
  153.   
  154.       move_type = (ChessMove) yylex();
  155.   
  156. !     if (xboardDebug) {
  157.           if (move_type == BadMove)
  158. !             fprintf(stderr, "Parsed BadMove: %s\n", yytext);
  159. !         else if (move_type == Comment)
  160. !             fprintf(stderr, "Parsed Comment: %s\n", yytext);
  161. !         else if ((move_type ==  WhiteWins) || (move_type == BlackWins)
  162. !             || (move_type == GameIsDrawn) || (move_type == StartGame))
  163. !             fprintf(stderr, "Parsed EndOfGame: %s\n", yytext);
  164.           else
  165.               fprintf(stderr, "Parsed %s into %s", yytext, currentMoveString);
  166. +     }
  167.   
  168.       switch (move_type) {
  169.       case Comment:
  170. ***************
  171. *** 1415,1421 ****
  172.               strcpy(parseList[currentMove], "0-1");
  173.       case GameIsDrawn:
  174.           if (move_type == GameIsDrawn)
  175. !             strcpy(parseList[currentMove], "1/2");
  176.           CopyBoard(boards[currentMove + 1], boards[currentMove]);
  177.           forwardMostMove = currentMove++;
  178.       default:
  179. --- 1421,1427 ----
  180.               strcpy(parseList[currentMove], "0-1");
  181.       case GameIsDrawn:
  182.           if (move_type == GameIsDrawn)
  183. !             strcpy(parseList[currentMove], "1/2-1/2");
  184.           CopyBoard(boards[currentMove + 1], boards[currentMove]);
  185.           forwardMostMove = currentMove++;
  186.       default:
  187. ***************
  188. *** 1979,1984 ****
  189. --- 1985,1992 ----
  190.           strcpy(error_buf, buf);
  191.           sprintf(buf, "Can't open %s", error_buf);
  192.           DisplayMessage(buf);
  193. +         XtFree(appData.readGameFile);
  194. +         appData.readGameFile = NULL;
  195.           return (int) False;
  196.       }
  197.   
  198. ***************
  199. *** 2045,2051 ****
  200.       }
  201.   
  202.       if ((gameMode == EndOfGame) || (matchMode != MatchFalse)
  203. !         || ((currentMove == 0) && (forwardMostMove == 0)))
  204.           return;
  205.   
  206.       if (gameMode != PauseGame) {
  207. --- 2053,2060 ----
  208.       }
  209.   
  210.       if ((gameMode == EndOfGame) || (matchMode != MatchFalse)
  211. !         || ((currentMove == 0) && (forwardMostMove == 0))
  212. !         || (currentMove >= forwardMostMove))
  213.           return;
  214.   
  215.       if (gameMode != PauseGame) {
  216. ***************
  217. *** 2060,2066 ****
  218.           ReadGameFileProc();
  219.           if ((strcmp(parseList[currentMove], "1-0") == 0)
  220.               || (strcmp(parseList[currentMove], "0-1") == 0)
  221. !             || (strcmp(parseList[currentMove], "1/2") == 0)
  222.               || (strcmp(parseList[currentMove], "End Of Game") == 0))
  223.               DisplayMessage(parseList[currentMove]);
  224.           return;
  225. --- 2069,2075 ----
  226.           ReadGameFileProc();
  227.           if ((strcmp(parseList[currentMove], "1-0") == 0)
  228.               || (strcmp(parseList[currentMove], "0-1") == 0)
  229. !             || (strcmp(parseList[currentMove], "1/2-1/2") == 0)
  230.               || (strcmp(parseList[currentMove], "End Of Game") == 0))
  231.               DisplayMessage(parseList[currentMove]);
  232.           return;
  233. ***************
  234. *** 2147,2152 ****
  235. --- 2156,2163 ----
  236.           strcpy(line, buf);
  237.           sprintf(buf, "Can't open %s", line);
  238.           DisplayMessage(buf);
  239. +         XtFree(appData.readPositionFile);
  240. +         appData.readPositionFile = NULL;
  241.           return (int) False;
  242.       }
  243.   
  244. ***************
  245. *** 2211,2216 ****
  246. --- 2222,2233 ----
  247.           return;
  248.       }
  249.   
  250. +     if ((WHITE_ON_MOVE && gameMode == MachinePlaysWhite)
  251. +         || (!WHITE_ON_MOVE && gameMode == MachinePlaysBlack)) {
  252. +         DisplayMessage("Wait until your turn");
  253. +         return;
  254. +     }
  255.       if (gameMode == BeginningOfGame)
  256.           gameMode = lastGameMode;
  257.       else
  258. ***************
  259. *** 2591,2599 ****
  260.       FILE *fp;
  261.   {
  262.       if (xboardDebug)
  263. !         fprintf(stderr, "Sending to %s: %s",
  264.               fp == toFirstProgFP ? "first" : "second", message);
  265. !     fputs(message, fp);
  266.   }
  267.   
  268.   void
  269. --- 2608,2620 ----
  270.       FILE *fp;
  271.   {
  272.       if (xboardDebug)
  273. !         fprintf(stderr, "Sending to %s: %s\n",
  274.               fp == toFirstProgFP ? "first" : "second", message);
  275. !     if (message[strlen(message) - 1] != '\n')
  276. !         fprintf(fp, "\n%s\n", message);
  277. !     else
  278. !         fputs(message, fp);
  279.   }
  280.   
  281.   void
  282. diff -c rev5/xboard.h rev6/xboard.h
  283. *** rev5/xboard.h    Wed Jun 12 13:35:17 1991
  284. --- rev6/xboard.h    Thu Jun 20 15:45:29 1991
  285. ***************
  286. *** 42,48 ****
  287.   #define FIRST_HOST                "localhost"
  288.   #define SECOND_HOST                "localhost"
  289.   #define MATCH_MODE                "False"
  290. ! #define INIT_STRING                "new\nbeep\nrandom\n"
  291.   #define WHITE_STRING            "white\ngo\n"
  292.   #define BLACK_STRING            "black\ngo\n"
  293.   #define WHITE_PIECE_COLOR        "#FFFFCC"
  294. --- 42,48 ----
  295.   #define FIRST_HOST                "localhost"
  296.   #define SECOND_HOST                "localhost"
  297.   #define MATCH_MODE                "False"
  298. ! #define INIT_STRING                "new\nbeep\nrandom\neasy\n"
  299.   #define WHITE_STRING            "white\ngo\n"
  300.   #define BLACK_STRING            "black\ngo\n"
  301.   #define WHITE_PIECE_COLOR        "#FFFFCC"
  302.  
  303. --
  304. Dan Heller
  305. O'Reilly && Associates       Z-Code Software    Comp-sources-x:
  306. Senior Writer                President          comp-sources-x@uunet.uu.net
  307. argv@ora.com                 argv@zipcode.com
  308.